function varStruct = GetAllVariables(filePath)

% Returns a structure containing all the variables in a Cicero variables
% file. For every run Cicero makes a file called
% 'RunLog-YEAR-MN-DYTXX-XX-XX.txt' where XX-XX-XX is the current time, DY
% is today's date, MN the current month, and YEAR the current year. 
% E.g. RunLog-2013-10-07T17-15-23.txt. The variables are listed as name - 
% value pairs. E.g.:
%
% IterationNum 125
% IterationCount 132
% vf -12.335345345345
%
% See also GETVARIABLEVALUE

fileID = fopen(filePath);
if fileID ~= -1
    while ~feof(fileID)
        line = fgetl(fileID);
        [varName,varValue] = strtok(line);
        eval(['varStruct.' varName ' = str2num(varValue);']);
    end
else
    error([filePath ' can not be opened'])
end
fclose(fileID);

end